package homeWork0601;

import java.util.Scanner;

public class Main {
       public static void main(String[] args) {
            Scanner in=new Scanner(System.in);
            System.out.println("1.轿车\t2.客车");
            System.out.println("请选择:");
            int n=in.nextInt();
            Car car=null;

            switch (n){
                case 1:
                    System.out.println("轿车的品牌如下:");
                    System.out.println("1.宝马");
                    System.out.println("2.别克");
                    System.out.println("请选择:");
                    n=in.nextInt();
                    switch (n){
                        case 1:
                            car=new BaoMa(800);
                            break;
                        case 2:
                            car=new BieKe(300);
                            break;
                    }
                    break;
                case 2:
                    System.out.println("客车类型如下：");
                    System.out.println("1.十五座以下");
                    System.out.println("2.十五座以上");
                    System.out.println("请选择");
                    n=in.nextInt();
                    switch (n){
                        case 1:
                            car=new JinBei(500);
                            break;
                        case 2:
                            car=new JinLong(800);
                            break;
                    }
                    break;
            }
            System.out.println("日租金:"+car.getZuJin());
            System.out.println("你租赁的天数:");
            n=in.nextInt();
            car.setTianShu(n);
            String msg=car.print();
            System.out.println(msg);
    }
}
